#pragma once

#include "Duplicate/Duplicate.h"


//剧情副本
class StoryDuplicate : public Duplicate
{
	struct SDupCharInfo
	{
		string strName;
		int32_t prof;
		int32_t sex;
		SDupCharInfo()
		{
			strName.clear();
			prof = 0;
			sex = 0;
		}
	};
	typedef unordered_map<uint64_t, SDupCharInfo> MapDupCharInfo;
	typedef unordered_map<uint64_t, VEC_ITEM_PROTO_EX> PickUpDropMap;//玩家拾取的掉落物品
public:
	////////////////////////////////  Duplicate  //////////////////////////////////////////
	//初始化
	virtual bool Init(uint32_t nDuplicateID, uint32_t nSceneID, IBrushMonster *pBrush);
	//
	virtual void UnInit();
protected:
	virtual void OnReady_State();
	virtual void OnBegin_State();
	virtual void OnFinish_State();
	virtual void OnFlop_State();
	virtual void OnClean_State();
	virtual void OnDestory_State();
	//定时器更新
	virtual void OnTimerUpdate(uint32_t nTimerID);
	//执行事件
	virtual void OnExecuteEvent(uint16_t nEventID, uint32_t nSrcID, uint8_t bySrcType, void *pContext, int32_t nLen);
	//进入场景
	virtual void OnCreatureEnter(Creature *pCreature);
	//生物离开副本
	virtual void OnPlayerLeave(Player *pPlayer);
	//是否能进入
	virtual bool OnCanEnter(Creature *pCreature);
	//进入区域
	virtual bool OnEnterArea(uint32_t nAreaID);
	//复活
	virtual void OnRelive(Player *pPlayer, int8_t byType);
	//拾取掉落了
	virtual void PickDrop(CharIDType cid, string &strName, int32_t prof, int32_t sex, VEC_ITEM_PROTO_EX &vecPickDrop);
	//设置副本掉落数据
	virtual void SetDropData(DupAllDropProto &protoData);
public:
	explicit StoryDuplicate();
	virtual ~StoryDuplicate();
private:
	//玩家拾取的掉落物品(筛选之后的拾取物品)
	PickUpDropMap m_mapPlayerPick;
	//玩家信息
	MapDupCharInfo m_mapDupCharInfo;
};